#include <iostream>
#include <cstdio>
#include <cmath>
int main() {
	int T;
	scanf("%d", &T);
	double l,d;
	while (T--) {
		std::cin>>l>>d;
		if (l-d<=0.000001) {
			printf("0.000000\n");
			continue;
		}
		printf("%0.6llf\n", log(l/d)+1);
	}
	return 0;
} 
